//此处引入 chunk优化
import './libs/fairygui';

import { Engine } from '@babylonjs/core/Engines/engine';
import View from './utils/ui';

import { Enter } from './views';
export const start = () => {
    fairygui.UIConfig.packageFileExtension = 'bin'
    Laya.stage.addChild(fgui.GRoot.inst.displayObject);
    View.open(Enter);
    
    const canvas = Laya.Browser.mainCanvas.source;
    // Generate the BABYLON 3D engine
    const engine = new Engine(canvas, true);

    import('./scenes/scene').then(({ default: Scene }) => {
        let scene = new Scene().create(engine, canvas);
        engine.runRenderLoop(function () {
            scene.render();
        });
    });
}